﻿using System;

using Caliburn.Micro;

namespace Cooking.Client.CaliburnExtensions
{
    public abstract class SimpleCoroutine : IResult
    {
        public event EventHandler<ResultCompletionEventArgs> Completed = delegate { };

        public void Execute(ActionExecutionContext context)
        {
            OnExecute();
        }

        protected abstract void OnExecute();

        protected void OnComplete()
        {
            Completed(this, new ResultCompletionEventArgs());
        }
    }
}